/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

/**
 * <p>Project: app2022 - While1
 * <p>Powered by webrx On 2022-01-08 10:47:56
 *
* @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class While1 {
    public static void main(String[] args) {
        int i = 1;
        while (i <= 5) {
            //System.out.println(++i); //2 3 4 5 6
            //System.out.println(i--); //1 2 3 4 5
            System.out.println(i);
            i = 6;
        }

        int s = 0;
        int n = 1;
        while (n <= 100) {
            s += n++;
        }
        System.out.println("1+2+3+...+100 = " + s);
    }
}
